2 extends DialogicPortrait
4 # If the custom portrait accepts a change, then accept it here
5 func _update_portrait(passed_character:DialogicCharacter, passed_portrait:String) -> void:
6 if passed_portrait == "":
7 passed_portrait = passed_character['default_portrait']
9 if $Sprite.sprite_frames.has_animation(passed_portrait):
10 $Sprite.play(passed_portrait)
12 func _on_animated_sprite_2d_animation_finished() -> void:
13 $Sprite.frame = randi()%$Sprite.sprite_frames.get_frame_count($Sprite.animation)
17 func _get_covered_rect() -> Rect2:
18 return Rect2($Sprite.position, $Sprite.sprite_frames.get_frame_texture($Sprite.animation, 0).get_size()*$Sprite.scale)